package trab;

import java.io.IOException;
import java.nio.file.Path;

public class ThreadPath extends Thread {

	private Path origem;
	private Path destino;
	private ChecksDirectories checksDirectories;

	public ThreadPath(Path origem, Path destino, ChecksDirectories checksDirectories) {
		this.origem = origem;
		this.destino = destino;
		this.checksDirectories = checksDirectories;
	}

	public void run() {
		while (true) {
			try {
				checksDirectories.setDestino(destino.toFile().getAbsolutePath());
				checksDirectories.setOrigem(origem.toFile().getAbsolutePath());
				
				checksDirectories.percorreDiretorio(origem, destino);
				
				Thread.sleep(5000);
				
			} catch (IOException | InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
	}
}
